// 地图模板
map = new BMap.Map("allmap"); // 创建Map实例
map.enableScrollWheelZoom(); //启用滚轮放大缩小
map.addControl(new BMap.MapTypeControl({
	mapTypes: [BMAP_NORMAL_MAP, BMAP_HYBRID_MAP]
})); //2D图，卫星图
map.addControl(new BMap.MapTypeControl({
	anchor: BMAP_ANCHOR_TOP_LEFT
})); //左上角，默认地图控件
var myCity = new BMap.LocalCity();
myCity.get(function(result) {
	console.log(result)
	cityName = result.name;
	var point = new BMap.Point(result.center.lng, result.center.lat);
	map.centerAndZoom(point, 16);
	local = new BMap.LocalSearch(cityName, {
		renderOptions: {
			map: map,
			panel: "map_bounds"
		},
		pageCapacity: 20
	});
	local.searchInBounds(["辅导", "培训", "中学", "教育", "机构", "小区", "楼房"], boudns = map.getBounds());
	App.set("$Cache_BMap_Bounds", boudns);
	$(".BMap_Marker.BMap_noprint img").src = "/images/userhead.jpg"
});
// init_map(["教育", "机构", "培训"]);
// 首次加载地图
App.set("$Event.BMap_search_key", function() {
	var BMap_search_key = [App.get("$Cache_BMap_search_key")];
	if (BMap_search_key) {
		local.searchInBounds(BMap_search_key, map.getBounds());
	} else {
		myConfirm("请输入搜索内容！！！");
	};
})